package com.kun.action;

import javax.annotation.Resource;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.stereotype.Controller;

import com.kun.entity.CustomerEntity;
import com.kun.server.RegistServer;
import com.opensymphony.xwork2.ActionSupport;
@Controller
@Namespace("/")
public class RegistAction extends ActionSupport {
	
	private static final long serialVersionUID = 1L;
	//用户实体类
	private CustomerEntity customerEntity;
	@Resource(name="RegistServerImpl")
	private RegistServer registServer;
	
	/**
	 * 注册
	 * @return
	 */
	@Action(value="regist",results={
			@Result(name="success",location="/index.jsp")
	})
	public String regist(){
		return registServer.regist(customerEntity);
	}
	
	
	public CustomerEntity getCustomerEntity() {
		return customerEntity;
	}
	public void setCustomerEntity(CustomerEntity customerEntity) {
		this.customerEntity = customerEntity;
	}
	
	
}
